//
//  AccountManager.h
//  KiklinkApp
//
//  Created by LF on 14/10/22.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import <Foundation/Foundation.h>

extern NSString *const KEY_USERNAME;
extern NSString *const KEY_PASSWORD;

extern NSString *const KEY_TOKEN;
extern NSString *const KEY_UID;
extern NSString *const KEY_ICON_URL;
extern NSString *const KEY_PROFILE_URL;
extern NSString *const KEY_DISPLAY_NAME;


@interface AccountManager : NSObject

//打开主登录界面
+ (void)openLoginUI;

+ (void)openLoginUIWithCallback:(Callback)callback;

+ (void)sendVerificationCodeTo:(NSString*)phoneNumber;

+ (void)firstLoginKiklinkWithUsername:(NSString*)username password:(NSString*)password callback:(Callback)callback;

+ (void)autoLoginKiklinkWithCallback:(Callback)callback;

+ (void)loginSNSWithPlatform: (NSString*) platform callback:(Callback)callback;

+ (void)openBindPhoneUIWithUserData:(NSDictionary*)userData callback:(Callback)callback;

+ (void)logoutKiklinkWithCallback:(Callback)callback;

//-------------------------------------------------

//获取用户信息，key见本类顶部 KEY_***
+ (NSDictionary*)accountInfo;

+ (void)clearAccountInfo;

+ (void)saveAccountInfo:(NSDictionary*)dict;

+ (BOOL)isKiklinkLoggedin;

+ (void)setIsKiklinkLoggedin:(BOOL)is;

+ (BOOL)isThirdParty;

+ (void)setIsThirdParty:(BOOL)is;

//验证输入合法性--------------------------------------

+ (BOOL)isPasswordValid:(NSString*) target;

+ (BOOL)isPhoneNumberValid:(NSString*) target;

+ (BOOL)isVerificationCodeValid:(NSString*) target;


//分享-------------------------------------------

+ (void) openSNSShareUIWithSharedText:(NSString*)text shareImage:(UIImage*)image;

@end
